package com.lhx.sort;

public class Selection {
    public void SelectionSort(int[] a) {
        int record = 0;
        int temp = 0;
        for(int i=0; i<a.length-1; i++) {
            record = i;
           for(int j=i+1; j<a.length; j++) {
               if(a[j] < a[record]) {
                   record = j;
               }
           }
           temp = a[i];
           a[i] = a[record];
           a[record] = temp;
        }
        //return a;
    }
}
